<template>
	<div @click="handleToolbarItemClick" class="app-mob-toolbar-item">
		<van-cell>
			<template v-if="item.showIcon && item.iconCls" #icon>
				<AppIcon
					:iconClass="item.iconCls"
					class="app-mob-toolbar-item-icon"
					:imgPath="item.imgPath"
				></AppIcon>
			</template>
			<template v-if="item.showCaption" #title>
				<div class="toolbar-item-title">{{ item.caption }}</div>
			</template>
		</van-cell>
	</div>
</template>
<script setup lang="ts">
import { toolbarItemProps } from '../toolbar';
const props = defineProps(toolbarItemProps);
const emit = defineEmits(['itemClick']);
const handleToolbarItemClick = (event: any) => {
	emit('itemClick', props.item.name, event, props.item.logic);
};
</script>
